subroutine read_recoil(nras,fn)
  use param
  use global
  implicit none
  integer,intent(in) :: nras
  character,intent(in) :: fn*(*)
  integer :: i
  open(unit=nras,file=fn,status='old')
  read(nras,*) n_rspec
  n_egrid=n_rspec+1
  allocate(egrid(n_egrid))
  allocate(rgrid(n_rspec))
  allocate(rspec(n_rspec))
  allocate(rspec1(n_rspec))
  allocate(rspec2(n_rspec))
  allocate(rspec3(n_rspec))
  allocate(rspec4(n_rspec))
  allocate(res(n_rspec))
  allocate(e_split(1000))
  sum_rspec=0.0
  do i=1,n_rspec
     read(nras,*) egrid(i),egrid(i+1),rspec1(i),rspec2(i),rspec3(i),rspec4(i)
     rgrid(i)=0.5*(egrid(i)+egrid(i+1))
     rspec(i)=rspec1(i)
     sum_rspec=sum_rspec+rspec1(i)
     res(i)=rspec(i)
  end do
  close(nras)
end subroutine read_recoil
